package com.winexpress.util;

public class EmailManager implements Runnable {

    String toEmail;
    String subtject;
    String body;

    public EmailManager(String toEmail, String subject, String body) {
        this.body = body;
        this.subtject = subject;
        this.toEmail = toEmail;
    }

    public void send(String toEmail, String subject, String body) {
        try {
            Email email = new Email(toEmail, subject, body);
            email.send();
        } catch (Exception ex) {

        }
    }

    public String getToEmail() {
        return toEmail;
    }

    public void setToEmail(String toEmail) {
        this.toEmail = toEmail;
    }

    public String getSubtject() {
        return subtject;
    }

    public void setSubtject(String subtject) {
        this.subtject = subtject;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    @Override
    public void run() {
        send(toEmail, subtject, body);
    }
}
